#include "facade.h"
#include <iostream>
using namespace facade;

void PopcornPopper::On()
{
   std::cout << "popper on!" << std::endl;
}

void PopcornPopper::Off()
{
    std::cout << "popper off!" << std::endl;
}

void PopcornPopper::Pop()
{
    std::cout << "popper pop!" << std::endl;
}

void TheaterLights::Dim()
{
    std::cout << "theaterlights dim!" << std::endl;
}

void TheaterLights::On()
{
    std::cout << "theaterlights on!" << std::endl;
}

void Screen::Down()
{
    std::cout << "screen down!" << std::endl;
}

void Screen::Up()
{
    std::cout << "screen up!" << std::endl;
}

void Projector::On()
{
    std::cout << "projector on!" << std::endl;
}

void Projector::Off()
{
    std::cout << "projector off!"  << std::endl;
}

void Projector::WideScreenMode()
{
    std::cout << "projector widescreenmode!" << std::endl;
}

void Amplifier::On()
{
    std::cout << "amplifier on!" << std::endl;
}

void Amplifier::Off()
{
    std::cout << "amplifier off!" << std::endl;
}

void Amplifier::SetDvd()
{
    std::cout << "amplifier setdvd!" << std::endl;
}

void Amplifier::SetSurroundSound()
{
    std::cout << "amplifier setsurroundsound!" << std::endl;
}

void Amplifier::SetVolume()
{
    std::cout << "amplifier setvolume!" << std::endl;
}

void DvdPlayer::On()
{
    std::cout << "dvdplayer on!" << std::endl;
}

void DvdPlayer::Off()
{
    std::cout << "dvdplayer off!" << std::endl;
}

void DvdPlayer::Play()
{
    std::cout << "dvdplayer play!" << std::endl;
}

void DvdPlayer::Stop()
{
    std::cout << "dvdplayer stop!" << std::endl;
}

void DvdPlayer::Eject()
{
    std::cout << "dvdplayer eject!" << std::endl;
}

HomeTheaterFacade::HomeTheaterFacade(Amplifier* a, DvdPlayer* d,
                      Projector* p, TheaterLights* l,
                      Screen* s, PopcornPopper* po)
{
    this->m_amp = a;
    this->m_dvd = d;
    this->m_projector = p;
    this->m_light = l;
    this->m_screen = s;
    this->m_popper = po;
}

void HomeTheaterFacade::WatchMovie()
{
    this->m_popper->On();
    this->m_popper->Pop();
    this->m_light->Dim();
    this->m_screen->Down();
    this->m_projector->On();
    this->m_projector->WideScreenMode();
    this->m_amp->On();
    this->m_amp->SetDvd();
    this->m_amp->SetSurroundSound();
    this->m_amp->SetVolume();
    this->m_dvd->On();
    this->m_dvd->Play();
}

void HomeTheaterFacade::EndMovie()
{
    this->m_popper->Off();
    this->m_light->On();
    this->m_screen->Up();
    this->m_projector->Off();
    this->m_amp->Off();
    this->m_dvd->Stop();
    this->m_dvd->Eject();
    this->m_dvd->Off();
}
